﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjectItemForm
{
    public partial class Form1 : Form
    {
        CINIFactory systemPara;
        public Form1()
        {
            InitializeComponent();
            this.comboBox1.SelectedIndex = 0;
            systemPara = new CINIFactory(System.Environment.CurrentDirectory + "\\", "item");
            int seIndex = int.Parse(systemPara.ReadIniData("item", "type", ""));
            if(seIndex > -1)
                this.comboBox1.SelectedIndex = seIndex;
        }

        private void btn_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btn_save_Click(object sender, EventArgs e)
        {
            int seIndex = this.comboBox1.SelectedIndex;
            systemPara.WriteIniData("item", "type", seIndex.ToString());
            this.Close();
        }
    }
}
